home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / lib / rpm-3.0.6 / macros < prev    next >
Encoding:
Text File  |  2001-04-06  |  18.6 KB  |  600 lines

  1. # $Id: macros.in,v 1.47.2.3.2.1 2000/08/28 15:19:45 jbj Exp $
  2. #
  3. # This is a global RPM configuration file. All changes made here will
  4. # be lost when the rpm package is upgraded. Any per-system configuration
  5. # should be added to /etc/rpm/macros, while per-user configuration should
  6. # be added to ~/.rpmmacros.
  7. #
  8. #==============================================================================
  9. # Macro naming conventions (preliminary):
  10. #
  11. #    Macros that begin with an underscore are "local" in the sense that
  12. #    they (if used) will not be exported in rpm headers. Some macros
  13. #    that don't start with an underscore (but look like they should)
  14. #    are compatible with macros generated by rpm-2.5.x and will be made
  15. #    more consistent in a future release.
  16. #
  17.  
  18. #==============================================================================
  19. # ---- A macro that expands to nothing.
  20. #
  21. %nil    %{!?nil}
  22.  
  23. #==============================================================================
  24. # ---- filesystem macros.
  25. #
  26. %_usr            /usr
  27. %_usrsrc        %{_usr}/src
  28. %_var            /var
  29.  
  30. #==============================================================================
  31. # ---- Generally useful path macros.
  32. #
  33. %__awk            gawk
  34. %__bzip2        %{_bzip2bin}
  35. %__cat            /bin/cat
  36. %__chgrp        /bin/chgrp
  37. %__chmod        /bin/chmod
  38. %__chown        /bin/chown
  39. %__cp            /bin/cp
  40. %__cpio            /bin/cpio
  41. %__grep            /usr/bin/grep
  42. %__gzip            %{_gzipbin}
  43. %__id            /usr/bin/id
  44. %__install        /usr/bin/install
  45. %__ln_s            ln -s
  46. %__make            /usr/bin/make
  47. %__mkdir        /bin/mkdir
  48. %__mkdir_p        /bin/mkdir -p
  49. %__mv            /bin/mv
  50. %__patch        /usr/bin/patch
  51. %__perl            /usr/bin/perl
  52. %__pgp            %{_pgpbin}
  53. %__rm            /bin/rm
  54. %__rsh            /usr/bin/rsh
  55. %__sed            /bin/sed
  56. %__ssh            /usr/bin/ssh
  57. %__tar            /bin/tar
  58.  
  59. #==============================================================================
  60. # ---- Build system path macros.
  61. #
  62. %__ar            ar
  63. %__cc            gcc
  64. %__cpp            gcc -E
  65. %__ld            /usr/bin/ld
  66. %__nm            /usr/bin/nm
  67. %__objcopy        /usr/bin/objcopy
  68. %__objdump        /usr/bin/objdump
  69. %__ranlib        ranlib
  70. %__remsh        %{__rsh}
  71. %__strip        /usr/bin/strip
  72.  
  73. # XXX avoid failures if tools are not installed when rpm is built.
  74. %__libtoolize        libtoolize
  75. %__aclocal        aclocal
  76. %__autoheader        autoheader
  77. %__automake        automake
  78. %__autoconf        autoconf
  79.  
  80. #==============================================================================
  81. # ---- Required rpmrc macros.
  82. #    Macros that used to be initialized as a side effect of rpmrc parsing.
  83. #    These are the default values that can be overridden by other
  84. #    (e.g. per-platform, per-system, per-packager, per-package) macros.
  85. #
  86. %_builddir        %{_topdir}/BUILD
  87. %_buildshell        /bin/sh
  88. %_bzip2bin        /bin/bzip2
  89. %_dbpath        %{_var}/lib/rpm
  90. %_dbpath_rebuild    %{_dbpath}
  91. %_defaultdocdir        %{_usr}/doc
  92. #
  93. %__find_provides    /usr/lib/rpm-3.0.6/find-provides
  94. %__find_requires    /usr/lib/rpm-3.0.6/find-requires
  95. #%__find_prereq        ???
  96. #%__find_conflicts    ???
  97. #%__find_obsoletes    ???
  98. #
  99. # XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
  100. %__id_u            %{__id} -u
  101. %__chown_Rhf        %{__chown} -Rhf
  102. %__chgrp_Rhf        %{__chgrp} -Rhf
  103. %_fixowner        [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
  104. %_fixgroup        [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root
  105. %_fixperms        %{__chmod} -Rf a+rX,g-w,o-w
  106. #
  107. %_gzipbin        /bin/gzip
  108. %_instchangelog        5
  109. %_pgpbin        /usr/bin/pgp
  110. %_rpmdir        %{_topdir}/RPMS
  111. #
  112. # XXX Note escaped %% for use in headerSprintf
  113. %_rpmfilename        %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
  114. %_signature        none
  115. %_sourcedir        %{_topdir}/SOURCES
  116. %_specdir        %{_topdir}/SPECS
  117. %_srcrpmdir        %{_topdir}/SRPMS
  118. %_tmppath        %{_var}/tmp
  119. %_topdir        %{_usrsrc}/RedmondLinux
  120.  
  121. #==============================================================================
  122. # ---- Optional rpmrc macros.
  123. #    Macros that are initialized as a side effect of rpmrc and/or spec
  124. #    file parsing.
  125. #
  126. #    Configurable build root path, same as BuildRoot: in a specfile.
  127. #    (Note: the configured macro value will override the spec file value).
  128. #
  129. #%buildroot
  130.  
  131. #    The sub-directory (relative to %{_builddir}) where sources are compiled.
  132. #    This macro is set after processing %setup, either explicitly from the
  133. #    value given to -n or the default name-version.
  134. #
  135. #%buildsubdir
  136.  
  137. #    Configurable distribution information, same as Distribution: tag in a
  138. #    specfile.
  139. #
  140. #%distribution
  141.  
  142. #    Configurable distribution URL, same as DistURL: tag in a specfile.
  143. #    The URL will be used to supply reliable information to tools like
  144. #    rpmfind.
  145. #
  146. # Note: You should not configure with disturl (or build packages with
  147. # the DistURL: tag) unless you are willing to supply content in a
  148. # yet-to-be-determined format at the URL specified.
  149. #
  150. #%disturl
  151.  
  152. #    Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
  153. #    marked as %doc should be installed.
  154. #%_excludedocs
  155.  
  156. #    The port and machine name of a FTP proxy host running TIS firewall.
  157. #
  158. #%_ftpport
  159. #%_ftpproxy
  160.  
  161. #    The signature to use and the location of configuration files for
  162. #    signing packages with GNU gpg.
  163. #
  164. #%_gpg_name
  165. #%_gpg_path
  166.  
  167. #    The port and machine name of an HTTP proxy host.
  168. #
  169. #%_httpport
  170. #%_httpproxy
  171.  
  172. #    The PATH put into the environment before running %pre/%post et al.
  173. #
  174. %_install_script_path    /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
  175.  
  176. #    A colon separated list of desired locales to be installed;
  177. #    "all" means install all locale specific files.
  178. #    
  179. %_install_langs    all
  180.  
  181. #
  182. #    Deprecated.
  183. #%_langpatt
  184.  
  185. #    A colon separated list of paths where files should *not* be installed.
  186. #    Usually, these are network file system mount points.
  187. #
  188. #%_netsharedpath
  189.  
  190. #    Configurable packager information, same as Packager: in a specfile.
  191. #
  192. #%packager
  193.  
  194. #    Compression type and level for source/binary package payloads.
  195. #        "w9.gzdio"    gzip level 9 (default).
  196. #        "w9.bzdio"    bzip2 level 9.
  197. #
  198. #%_source_payload    w9.gzdio
  199. #%_binary_payload    w9.gzdio
  200.  
  201. #    The signature to use and the location of configuration files for
  202. #    signing packages with PGP.
  203. #
  204. #%_pgp_name
  205. #%_pgp_path
  206.  
  207. #    Configurable virtual provides (unimplemented, use Provides: ...
  208. #    in an rpmrc file).
  209. #
  210. #%_provides
  211.  
  212. #    Deprecated.
  213. #
  214. #%_timecheck
  215.  
  216. #    Configurable vendor information, same as Vendor: in a specfile.
  217. #
  218. #%vendor
  219.  
  220. #==============================================================================
  221. # ---- per-platform macros.
  222. #    Macros that are specific to an individual platform. The values here
  223. #    will be used if the per-platform macro file does not exist..
  224. #
  225. %_arch            i386
  226. %_vendor        pc
  227. %_os            linux
  228. %_target_platform    %{_target_cpu}-%{_vendor}-%{_target_os}
  229. #
  230. # XXX use the rpmrc instantiated macro for now
  231. #%optflags        -O2
  232.  
  233. %__arch_install_post    %{nil}
  234. %__os_install_post    %{___build_post}
  235.  
  236. #==============================================================================
  237. # ---- Scriptlet template templates.
  238. #    Global defaults used for building scriptlet templates.
  239. #
  240. # XXX legacy configuration, this will be eliminated after rpm-3.0.4.
  241. %_preScriptEnvironment    \
  242. RPM_SOURCE_DIR=\"%{_sourcedir}\"\
  243. RPM_BUILD_DIR=\"%{_builddir}\"\
  244. RPM_OPT_FLAGS=\"%{optflags}\"\
  245. RPM_ARCH=\"%{_arch}\"\
  246. RPM_OS=\"%{_os}\"\
  247. export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
  248. RPM_DOC_DIR=\"%{_docdir}\"\
  249. export RPM_DOC_DIR\
  250. RPM_PACKAGE_NAME=\"%{name}\"\
  251. RPM_PACKAGE_VERSION=\"%{version}\"\
  252. RPM_PACKAGE_RELEASE=\"%{release}\"\
  253. export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
  254. %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
  255. export RPM_BUILD_ROOT}
  256.  
  257. %___build_shell        %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
  258. %___build_args        -e
  259. %___build_cmd        %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
  260. %___build_pre    \
  261. RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
  262. RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
  263. RPM_OPT_FLAGS=\"%{optflags}\"\
  264. RPM_ARCH=\"%{_arch}\"\
  265. RPM_OS=\"%{_os}\"\
  266. export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
  267. RPM_DOC_DIR=\"%{_docdir}\"\
  268. export RPM_DOC_DIR\
  269. RPM_PACKAGE_NAME=\"%{name}\"\
  270. RPM_PACKAGE_VERSION=\"%{version}\"\
  271. RPM_PACKAGE_RELEASE=\"%{release}\"\
  272. export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
  273. %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
  274. export RPM_BUILD_ROOT}\
  275. \
  276. %{verbose:set -x}%{!verbose:exec > /dev/null}\
  277. umask 022\
  278. cd %{u2p:%{_builddir}}\
  279.  
  280.  
  281. #%___build_body        %{nil}
  282. %___build_post        exit 0
  283.  
  284. %___build_template    #!%{___build_shell}\
  285. %{___build_pre}\
  286. %{nil}
  287.  
  288. #%{___build_body}\
  289. #%{___build_post}\
  290. #%{nil}
  291.  
  292. #==============================================================================
  293. # ---- Scriptlet templates.
  294. #    Macro(s) that expand to a command and script that is executed.
  295. #    CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
  296. #
  297. %__spec_prep_shell    %{___build_shell}
  298. %__spec_prep_args    %{___build_args}
  299. %__spec_prep_cmd    %{___build_cmd}
  300. %__spec_prep_pre    %{___build_pre}
  301. %__spec_prep_body    %{___build_body}
  302. %__spec_prep_post    %{___build_post}
  303. %__spec_prep_template    #!%{__spec_prep_shell}\
  304. %{__spec_prep_pre}\
  305. %{nil}
  306.  
  307. #%{__spec_prep_body}\
  308. #%{__spec_prep_post}\
  309. #%{nil}
  310.  
  311. %__spec_build_shell    %{___build_shell}
  312. %__spec_build_args    %{___build_args}
  313. %__spec_build_cmd    %{___build_cmd}
  314. %__spec_build_pre    %{___build_pre}
  315. %__spec_build_body    %{___build_body}
  316. %__spec_build_post    %{___build_post}
  317. %__spec_build_template    #!%{__spec_build_shell}\
  318. %{__spec_build_pre}\
  319. %{nil}
  320.  
  321. #%{__spec_build_body}\
  322. #%{__spec_build_post}\
  323. #%{nil}
  324.  
  325. %__spec_install_shell    %{___build_shell}
  326. %__spec_install_args    %{___build_args}
  327. %__spec_install_cmd    %{___build_cmd}
  328. %__spec_install_pre    %{___build_pre}
  329. %__spec_install_body    %{___build_body}
  330. %__spec_install_post\
  331. %{__arch_install_post}\
  332. %{__os_install_post}\
  333. %{nil}
  334. %__spec_install_template    #!%{__spec_install_shell}\
  335. %{__spec_install_pre}\
  336. %{nil}
  337.  
  338. #%{__spec_install_body}\
  339. #%{__spec_install_post}\
  340. #%{nil}
  341.  
  342. #%__spec_autodep_shell    %{___build_shell}
  343. #%__spec_autodep_args    %{___build_args}
  344. #%__spec_autodep_cmd    %{___build_cmd}
  345. #%__spec_autodep_pre    %{___build_pre}
  346. #%__spec_autodep_body    %{___build_body}
  347. #%__spec_autodep_post    %{___build_post}
  348. #%__spec_autodep_template    #!%{__spec_autodep_shell}\
  349. #%{__spec_autodep_pre}\
  350. #%{nil}
  351.  
  352. #%{__spec_autodep_body}\
  353. #%{__spec_autodep_post}\
  354. #%{nil}
  355.  
  356. %__spec_clean_shell    %{___build_shell}
  357. %__spec_clean_args    %{___build_args}
  358. %__spec_clean_cmd    %{___build_cmd}
  359. %__spec_clean_pre    %{___build_pre}
  360. %__spec_clean_body    %{___build_body}
  361. %__spec_clean_post    %{___build_post}
  362. %__spec_clean_template    #!%{__spec_clean_shell}\
  363. %{__spec_clean_pre}\
  364. %{nil}
  365.  
  366. #%{__spec_clean_body}\
  367. #%{__spec_clean_post}\
  368. #%{nil}
  369.  
  370. %__spec_rmbuild_shell    %{___build_shell}
  371. %__spec_rmbuild_args    %{___build_args}
  372. %__spec_rmbuild_cmd    %{___build_cmd}
  373. %__spec_rmbuild_pre    %{___build_pre}
  374. %__spec_rmbuild_body    %{___build_body}
  375. %__spec_rmbuild_post    %{___build_post}
  376. %__spec_rmbuild_template    #!%{__spec_rmbuild_shell}\
  377. %{__spec_rmbuild_pre}\
  378. %{nil}
  379.  
  380. #%{__spec_rmbuild_body}\
  381. #%{__spec_rmbuild_post}\
  382. #%{nil}
  383.  
  384. # XXX We don't expand pre/post install scriptlets (yet).
  385. #%__spec_pre_pre        %{nil}
  386. #%__spec_pre_post        %{nil}
  387. #%__spec_post_pre        %{nil}
  388. #%__spec_post_post        %{nil}
  389. #%__spec_preun_pre        %{nil}
  390. #%__spec_preun_post        %{nil}
  391. #%__spec_postun_pre        %{nil}
  392. #%__spec_postun_post        %{nil}
  393. #%__spec_triggerpostun_pre    %{nil}
  394. #%__spec_triggerpostun_post    %{nil}
  395. #%__spec_triggerun_pre        %{nil}
  396. #%__spec_triggerun_post        %{nil}
  397. #%__spec_triggerin_pre        %{nil}
  398. #%__spec_triggerin_post        %{nil}
  399.  
  400. #==============================================================================
  401. # ---- configure macros.
  402. #    Macro(s) slavishly copied from autoconf's config.status.
  403. #
  404. %_prefix        /usr
  405. %_exec_prefix        %{_prefix}
  406. %_bindir        %{_exec_prefix}/bin
  407. %_sbindir        %{_exec_prefix}/sbin
  408. %_libexecdir        %{_exec_prefix}/libexec
  409. %_datadir        %{_prefix}/share
  410. %_sysconfdir        %{_prefix}/etc
  411. %_sharedstatedir    %{_prefix}/com
  412. %_localstatedir        %{_prefix}/var
  413. %_lib            lib
  414. %_libdir        %{_exec_prefix}/%{_lib}
  415. %_includedir        %{_prefix}/include
  416. %_oldincludedir        /usr/include
  417. %_infodir        %{_prefix}/info
  418. %_mandir        %{_prefix}/man
  419.  
  420. #==============================================================================
  421. # ---- config.guess platform macros.
  422. #    Macro(s) similar to the tokens used by configure.
  423. #
  424. %_build            %{_host}
  425. %_build_alias        %{_host_alias}
  426. %_build_cpu        %{_host_cpu}
  427. %_build_vendor        %{_host_vendor}
  428. %_build_os        %{_host_os}
  429. %_host            i686-pc-linux-gnu
  430. %_host_alias        i686-pc-linux-gnu
  431. %_host_cpu        i686
  432. %_host_vendor        pc
  433. %_host_os        linux-gnu
  434. %_target        %{_host}
  435. %_target_alias        %{_host_alias}
  436. %_target_cpu        %{_host_cpu}
  437. %_target_vendor        %{_host_vendor}
  438. %_target_os        %{_host_os}
  439.  
  440. #==============================================================================
  441. # ---- specfile macros.
  442. #    Macro(s) here can be used reliably for reproducible builds.
  443. #    (Note: Above is the goal, below are the macros under development)
  444. #
  445. # The configure macro does the following:
  446. #    optionally change to a subdirectory (not implemented).
  447. #    attempt to update config.guess and config.sub.
  448. #    run configure with correct prefix, platform, and CFLAGS.
  449. #    optionally restore current directory (not implemented).
  450. # The configure macro should be invoked as %configure (rather than %{configure})
  451. # because the rest of the arguments will be expanded using %*. Another
  452. # gotcha is that arguments, if present, should be on the same line as the
  453. # %configure.
  454. #
  455. # This is the version of %configure used throuugh rpm-3.0.4.
  456. #%configure    \
  457. #  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
  458. #  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
  459. #
  460. #------------------------------------------------------------------------------
  461. # This is an improved version of %configure (from PLD team).
  462. %configure \
  463. CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  464. CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  465. FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  466. %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} ; \
  467. ./configure %{_target_platform} \\\
  468.      --prefix=%{_prefix} \\\
  469.     --exec-prefix=%{_exec_prefix} \\\
  470.     --bindir=%{_bindir} \\\
  471.     --sbindir=%{_sbindir} \\\
  472.     --sysconfdir=%{_sysconfdir} \\\
  473.     --datadir=%{_datadir} \\\
  474.     --includedir=%{_includedir} \\\
  475.     --libdir=%{_libdir} \\\
  476.     --libexecdir=%{_libexecdir} \\\
  477.     --localstatedir=%{_localstatedir} \\\
  478.     --sharedstatedir=%{_sharedstatedir} \\\
  479.     --mandir=%{_mandir} \\\
  480.     --infodir=%{_infodir}
  481. #------------------------------------------------------------------------------
  482. # The make install analogue of %configure:
  483. %makeinstall \
  484.    make \\\
  485.     prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
  486.     exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
  487.     bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
  488.     sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
  489.     sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
  490.     datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
  491.     includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
  492.     libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
  493.     libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
  494.     localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
  495.     sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
  496.     mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
  497.     infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
  498.    install
  499.  
  500. #------------------------------------------------------------------------------
  501. # The GNUconfigure macro does the following:
  502. #       update config.guess and config.sub.
  503. #       regenerate all autoconf/automake files
  504. #       optionally change to a directory (make the directory if requested).
  505. #       run configure with correct prefix, platform, and CFLAGS.
  506. #       optionally restore current directory.
  507. #
  508. # Based on autogen.sh from GNOME and orginal GNUconfigure
  509. #
  510. %GNUconfigure(MCs:)      \
  511.   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
  512.   LDFLAGS="${LDFLAGS:-'%{-s:-s}'}"  ; export LDFLAGS; \
  513.   %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
  514.   dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
  515.     for coin in `echo ${dirs}` \
  516. do \
  517.   dr=`dirname ${coin}`; \
  518. if test -f ${dr}/NO-AUTO-GEN; then \
  519.  : \
  520. else \
  521.      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
  522.     ( cd ${dr}; \
  523.       aclocalinclude="${ACLOCAL_FLAGS}"; \
  524.       for k in ${macrodirs}; do \
  525.         if test -d ${k}; then \
  526.           aclocalinclude="${aclocalinclude} -I ${k}"; \
  527.         ##else \
  528.         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
  529.         fi \
  530.       done \
  531.       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
  532.         if grep "sed.*POTFILES" configure.in >/dev/null; then \
  533.           : do nothing -- we still have an old unmodified configure.in \
  534.         else \
  535.           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
  536.           echo "no" | gettextize --force --copy; \
  537.           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
  538.         fi \
  539.       fi \
  540.       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
  541.         %{__libtoolize} --force --copy; \
  542.       fi \
  543.       aclocal ${aclocalinclude}; \
  544.       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
  545.         %{__autoheader}; \
  546.       fi \
  547.       echo "Running automake --gnu ${am_opt} ..."; \
  548.       %{__automake} --add-missing --gnu ${am_opt}; \
  549.       %{__autoconf}; \
  550.     ); \
  551.   fi \
  552. done \
  553.   %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \
  554.   %{-C:cd ${_mydir}; unset _mydir}
  555.  
  556. #------------------------------------------------------------------------------
  557. # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
  558. #
  559. # For example, these can be used as (from ImageMagick.spec from PLD site)
  560. #    [...]
  561. #    BuildPrereq: perl
  562. #    [...]
  563. #    %package perl
  564. #    Summary: libraries and modules for access to ImageMagick from perl
  565. #    Group: Development/Languages/Perl
  566. #    Requires: %{name} = %{version}
  567. #    %requires_eq    perl
  568. #    [...]
  569. #    %install
  570. #    rm -fr $RPM_BUILD_ROOT
  571. #    install -d $RPM_BUILD_ROOT/%{perl_sitearch}
  572. #    [...]
  573. #    %files perl
  574. #    %defattr(644,root,root,755)
  575. #    %{perl_sitearch}/Image
  576. #    %dir %{perl_sitearch}/auto/Image
  577. #
  578. %requires_eq()    %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}' %1| grep -v "is not")
  579. %perl_sitearch    %(eval "`perl -V:installsitearch`"; echo $installsitearch)
  580. %perl_archlib    %(eval "`perl -V:installarchlib`"; echo $installarchlib)
  581.  
  582. #------------------------------------------------------------------------------
  583. # arch macro for all Intel i?86 compatibile processors
  584. #  (Note: This macro (and it's analogues) will probably be obsoleted when
  585. #   rpm can use regular expressions against target platforms in macro
  586. #   conditionals. This change will be introduced after rpm-3.0.4).
  587. #
  588. %ix86   i386 i486 i586 i686 i786 i886 i986
  589.  
  590. #------------------------------------------------------------------------
  591. # Use in %install to generate locale specific file lists. For example,
  592. #
  593. # %install
  594. # ...
  595. # %find_lang %{name}
  596. # ...
  597. # %files -f %{name}.lang
  598. #
  599. %find_lang    /usr/lib/rpm-3.0.6/find-lang.sh %{buildroot}
  600.